<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="<?php echo base_url('static/order');?>/css/base.css">
    <link rel="stylesheet" href="<?php echo base_url('static/order');?>/css/style.css">
    <script src="<?php echo base_url('static/order');?>/js/jquery-1.7.2.min.js"></script>
    <title>派送详情</title>
</head>
<body>
    <div class="containerbox pr">
        <span class="close pos dk p5 m10"><img src="<?php echo base_url('static/order');?>/img/close.png" alt=""></span>
        <div class="mapbox pr">
        	<div id="map" style="width:100%;height:300px;"></div>
        </div>
        <?php if((bool)$data):?>
        <ul class="contentbox mt20 ">
        <?php $number = count($data['log']); 
        foreach ($data['log'] as $k => $v):?>
           <?php if($number > 1 && $k == 0):?>
           <li class="contentboc-details hengleft color">
               <div class="details-time pb20 pl10 pr15 ">
                   <span class="time-month f10"><?php echo date('m-d', $v['addtime']);?></span>
                   <span class="time-hour f085"><?php echo date('H:i', $v['addtime']);?></span>
               </div>
               <div class="details-con pb20 pl15 pr10 pr f10">
                    <span class="circle di" style="display:none;"></span>
                    <span class="nonespan pos"><img src="<?php echo base_url('static/order');?>/img/<?php echo $data['status'] == 4 ? 'allright.png' : 'middle.png';?>" alt=""></span>
                   	<?php echo $v['description'];?>
                </div>
           </li> 
           <?php elseif($number > 1 && $k == $number - 1):?>
           	<li class="contentboc-details hengleft ">
               <div class="details-time pb20 pl10 pr15 ">
                  <span class="time-month f10"><?php echo date('m-d', $v['addtime']);?></span>
                  <span class="time-hour f085"><?php echo date('H:i', $v['addtime']);?></span>
               </div>
               <div class="details-con pb20 pl15 pr10 pr f10">
                    <span class="circle di" style="display:none;"></span>
                    <span class="nonespan1 pos"><img src="<?php echo base_url('static/order');?>/img/slide.png" alt=""></span>
                    <?php echo $v['description'];?>
                </div>
           </li> 
           <?php else:?>
           <li class="contentboc-details hengleft ">
               <div class="details-time pb20 pl10 pr15 ">
                    <span class="time-month f10"><?php echo date('m-d', $v['addtime']);?></span>
                   <span class="time-hour f085"><?php echo date('H:i', $v['addtime']);?></span>
               </div>
               <div class="details-con pb20 pl15 pr10 pr f10"><?php echo $v['description'];?></div>
           </li> 
           <?php endif;?>
           <?php endforeach;?>
        </ul>
        <?php endif;?>
    </div>
</body>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=<?php echo $ak;?>"></script>
<script type="text/javascript">
	var map = null;
	$(function(){
		var pt = new BMap.Point(<?php echo $data['longitude'];?>, <?php echo $data['latitude'];?>);
		map = new BMap.Map("map");           
		map.centerAndZoom(pt, 15);
		map.enableScrollWheelZoom(true);
		var myIcon = new BMap.Icon("<?php echo base_url('static/img/order.png');?>", new BMap.Size(50,50));
		var marker2 = new BMap.Marker(pt, {icon:myIcon});  // 创建标注
		map.addOverlay(marker2);

		var pt = new BMap.Point(<?php echo $data['send_to_longitude'];?>, <?php echo $data['send_to_latitude'];?>);
		var myIcon = new BMap.Icon("<?php echo base_url('static/img/order.png');?>", new BMap.Size(50,50));
		var marker2 = new BMap.Marker(pt, {icon:myIcon});  // 创建标注
		map.addOverlay(marker2);

		<?php if($data['status'] > 1 && $data['status'] < 4):?>
			var pt = new BMap.Point(<?php echo $data['u_longitude'];?>, <?php echo $data['u_latitude'];?>);
			var myIcon = new BMap.Icon("<?php echo base_url('static/img/courier.png');?>", new BMap.Size(50,50));
			var marker2 = new BMap.Marker(pt, {icon:myIcon});  // 创建标注
			map.addOverlay(marker2);
		<?php endif;?>
	});
</script>
<script>
    $(function(){
        if($(".contentboc-details").length==1){
            $(this).css("border","none")
        }
    })
</script>
</html>